Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate expected fields normalization #765

Merged
merged 7 commits into from
Sep 7, 2022

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 29, 2022

ECS fields can include normalization rules, indicated by the normalize parameter.

By now only the array rule exist, that indicates that values should be included in the
field as an array, even if there is a single element.

Validate this on test results for packages with format_version >= 2.0.0.

Things to check in this review:

  • This new validation is only enabled for packages using package spec v2. This is the first time we do something like that in elastic-package.
  • Field validators can be configured now with the spec version of the package, this is done for all test runners that validate fields.
  • Apache test package has been upgraded to version 2.0.0 of the spec. This illustrates the kind of changes that package developers will need to do when updating to this major. In this case it was:
  • ECS has been upgraded in the Apache test package to a version that has normalization rules.

Part of #615 and elastic/package-spec#399.

@jsoriano jsoriano self-assigned this Mar 29, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 29, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-06T07:51:55.098+0000

  • Duration: 33 min 33 sec

Test stats 🧪

Test Results
Failed 0
Passed 787
Skipped 0
Total 787

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@jsoriano
Copy link
Member Author

jsoriano commented Mar 29, 2022

normalize is not included in the ECS file we import, we need to have these fields included in this file, or start using one of the generic ecs files (#766).

@jsoriano
Copy link
Member Author

jsoriano commented Apr 6, 2022

Blocked till we have some way of disabling checks per package (see #615 (comment)).

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 5, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (32/32) 💚
Files 66.949% (79/118)
Classes 62.424% (103/165)
Methods 49.851% (334/670)
Lines 33.485% (3017/9010)
Conditionals 100.0% (0/0) 💚

@jsoriano jsoriano requested review from andrewkroh and a team September 6, 2022 08:04
@jsoriano jsoriano marked this pull request as ready for review September 6, 2022 08:04
Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants